package com.jxl.dnd.charactercreator.vo.characterclasses
{
	import flash.events.EventDispatcher;

	[Bindable]
	public class CharacterClass extends EventDispatcher
	{
		
		public static const CLERIC:String		= "Cleric";
		public static const FIGHTER:String		= "Fighter";
		public static const PALADIN:String		= "Paladin";
		public static const RANGER:String		= "Ranger";
		public static const ROGUE:String		= "Rogue";
		public static const WARLOCK:String		= "Warlock";
		public static const WARLORD:String		= "Warlord";
		public static const WIZARD:String		= "Wizard";
		
		
		public var name:String;
		
		public function CharacterClass(name:String="Fighter"):void
		{
			super();
			
			this.name			= name;
		}
		
		public function buildFromObject(obj:Object):void
		{
			this.name				= obj.name;
		}
		
		public function toObject():Object
		{
			var obj:Object = new Object();
			obj.name = name;
			return obj;
		}
		
		public function toXML():XML
		{
			var myXML:XML = 
				<characterclass>
					<name>{name}</name>
				</characterclass>;
			return myXML;
		}
		
		public function buildFromXML(xml:XML):void
		{
			name = xml..characterclass.name;
		}
		
	}
}